package com.wc.算法提高课.C第三章_图论.二分图.骑士放置;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/10/23 2:35
 * @description https://www.acwing.com/problem/content/380/
 */
public class Main {
    /**
     * 思路：最大独立集 = 总点数 - 最小点覆盖 = 总点数 - 最大点匹配<p>
     * 把每个马能走到的点做成一个边, 那么就是选出一个最多的点集, 之间不存在任何一条边, 也就是最大独立集的概念
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 110;
    static boolean[][] g = new boolean[N][N];
    static Pair[][] match = new Pair[N][N];
    static boolean[][] st = new boolean[N][N];
    static int[] dx = {-1, 1, -2, 2, -2, 2, -1, 1};
    static int[] dy = {-2, -2, -1, -1, 1, 1, 2, 2};
    static int n, m, k;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        k = sc.nextInt();
        for(int i = 0; i < k; i ++){
            int a = sc.nextInt(), b = sc.nextInt();
            g[a][b] = true;
        }
        int res = 0;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
                if ((i + j & 1) == 0 && !g[i][j]) {
                    fill(st);
                    if (find(i, j)) res++;
                }
            }
        }
        out.println(n * m - k - res);
        out.flush();
    }

    static void fill(boolean[][] st) {
        for (int i = 1; i <= n; i++) Arrays.fill(st[i], 1, m + 1, false);
    }

    static boolean find(int x, int y) {
        for (int i = 0; i < 8; i++) {
            int a = x + dx[i], b = y + dy[i];
            if (a < 1 || a > n || b < 1 || b > m) continue;
            if (st[a][b] || g[a][b]) continue;
            st[a][b] = true;
            Pair t = match[a][b];
            if (t == null || find(t.x, t.y)) {
                match[a][b] = new Pair(x, y);
                return true;
            }
        }
        return false;
    }

    static class Pair implements Comparable<Pair> {
        int x, y;

        Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o) {
            if (x == o.x) {
                return y - o.y;
            }
            return x - o.x;
        }
    }

}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
